import React, {PureComponent} from 'react'
import echarts from 'echarts';
import '../../util/world'
import Icon from 'rc-ui/lib/Icon'
import {getTodayTallying} from '../../action/map.action'
import {connect} from 'react-redux'
const Path = Icon.Path

class Run extends PureComponent {
    constructor() {
        super()
    }

    componentDidMount() {
        const {dispatch} = this.props
        dispatch(getTodayTallying({}))
    }

    render() {
        const {todayTallying} = this.props
        return (
            <div className="product-container" style={{textAlign: 'center'}}>
                <div className="product-box">
                    <p>今日需完成订单</p>
                    <span>{todayTallying.get('待理货')}单</span>
                </div>

                <div className="product-box">
                    <p>今日已完成订单</p>
                    <span>{todayTallying.get('理货完成')}单</span>
                </div>

                <div className="product-box">
                    <p>今日新增订单</p>
                    <span>{todayTallying.get('理货中')}单</span>
                </div>
            </div>
        )
    }

}


function mapStateToProps({todayTallying}) {
    return {todayTallying}
}
export default connect(mapStateToProps)(Run)